/**
 * webpack.config.js entry output module{rules[{test,use}} plugins[] mode resolve 
 */
const path = require('path');
const HtmlWebpackPlugin = require('');

module.exports = {
  entry:'./src/index.js',
  output: {
    path: path.resolve(__dirname, './dist'),
    filename: '[name].[chunkhash].js'
  },
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: ['style-loader', 'css-loader'] 
      }
    ]
  },
  mode: 'development',
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  },
  plugins: [
    new HtmlWebpackPlugin({
      filename: "index.html",
      template: path.resolve(__dirname, 'template/index.html')
    })
  ]
}